import styles from './index.less';
import { Button } from 'antd'
import { request } from 'umi';
import { useState } from 'react'
export default function IndexPage() {
  const [info, setInfo] = useState({ name: '', id: '' })
  const getData = async () => {
    const res = await request('/api/index')
    setInfo(res)
  }
  return (
    <div>
      <h1 className={styles.title}>Page index</h1>
      <Button onClick={getData}>点我获取数据</Button>
      <p> {info.id + '----' + info.name}</p>
    </div>
  );
}
